<template>
  <transition name="fade">
    <div class="tips-wrapper">
      <div class="tips-content">
        <i class="iconfont">&#xe659;</i>
        <p class="tips-font">{{text}}</p>
      </div>
    </div>
  </transition>
</template>

<script>
  export default {
    name: "Tips",
    props: {
      text: {
        type: String,
        default: '添加成功，在购物车等亲~'
      }
    }
  }
</script>

<style scoped>
  .tips-wrapper{
    position: fixed;
    top: 50%;
    right: 0;
    left: 0;
    background-color: rgba(0,0,0,.7);
    z-index: 129;
    margin: -40px auto 0 auto;
    width: 50%;
    max-height: 300px;
    border-radius: 4px;
  }
  .tips-content{
    text-align: center;
  }
  .tips-content .tips-font{
    color: #fff;
    font-weight: 300;
    font-size: 14px;
    padding: 10px 0;
  }
  .iconfont{
    width: 100%;
    color: #FC5404;
    font-size: 30px;
    padding: 10px 0;
    display: inline-block;
  }
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s;
  }
  .fade-enter, .fade-leave-to {
    opacity: 0;
  }
</style>